package com.bmw.seed.util.bean;


import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * Classname: BaseRequest
 * Package: com.bmw.seed.util.bean
 * Description:
 *
 * @Author 王少伟
 * @Create 2024/1/28 17:40
 * @Version 1.8
 */

public class BaseRequest<T> implements Serializable {
    @NotNull(message = "设备类型不能为空")

    private String deviceType;
    @NotNull(message = "设备No参数不能为空")

    private String deviceNo;
    @NotNull(message = "当前版本参数不能为空")

    private String version;
    @NotNull(message = "渠道参数不能为空")

    private String channelId;
    //默认验证只是验证当前对象的属性，不会验证引入对象的属性（即data里面的字段就是加了参数验证的注解，也不会生效）
    //所以我们要在data上增加@Valid注解，这样data的属性如果增加了参数注解也会生效了
    @Valid
    private T data;

    public BaseRequest() {
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceNo() {
        return deviceNo;
    }

    public void setDeviceNo(String deviceNo) {
        this.deviceNo = deviceNo;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
